export class ScreenSize {
  public width: number = 1280;
  public height: number = 720;
  public initScreenSize(w: number, h: number) {
    this.width = w;
    this.height = h;
  }

  public isSmallerHeight() {
    return this.width / this.height < 1280 / 720;
  }
  public isSmallerWidth() {
    return this.width / this.height < 740 / 414;
  }
  public alignMargin() {
    const designWidth = 1280 * this.height / 720 ;
    // 大于时说明被裁剪了部分，那么尽力保持左对齐, 能把操作对象漏出即可
    // 小于，说明有部分多余，那么尽量依靠设计边界
    const diffWidth = (this.width - designWidth - 60) / 2;
    return Math.max(20, diffWidth);
  }
}